var Client = require('mysql').Client,
	client = new Client();
	
client.host = 'localhost';
client.user = 'root'
client.password = 'root';
client.database = 'test';
client.port = '3306';

exports.login = function(user,res){
	client.query('select * from user where id = '+ user.id 
				+' and passwd = password('+user.passwd+')', function(err, results, fields){
		if(err){
			throw err;
		}
		if(results.length == 1 ){
		
		}
		//res.write(fields+"\n");
		//for (var i in results){
		//	var data = JSON.stringify(results[i]);
			//res.write(data+"\n");
		//}
		//res.end();
	});
}

//console.log("server is started");